<?php

class Calendar {

    /**
     * Creates an array of one-day consecutive DateTime objects between two dates
     * @param DateTime $from starting DateTime of the Calendar
     * @param DateTime $to ending DateTime of the Calendar
     */
    public static function create($from, $to) {
        for ($d = clone $from; $d <= $to; $d->modify('+1 day')) {
            $calendar[] = clone $d;
        }
        return $calendar;
    }

}
?>
